package com.example.springbootyczy.controller;

import com.example.springbootyczy.entity.Student;
import com.example.springbootyczy.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class TestController {
    public TestController(){
        System.out.println("====================");
    }
    @Autowired
    IStudentService iStudentService;

    @GetMapping("/sayHello")
    public String sayHello(){
        //增加
        Student student = new Student();
        student.setNo("40000");
        boolean save = iStudentService.save(student);
        System.out.println("save: "+ save);
        //删除用户
        boolean b = iStudentService.removeById("2217de26fba04a79b753837f37105060");
        return "remove-flag" + b;
    }

    @GetMapping("/student/pageRout")
    public String listRout(){
        return "/pages/page.html";
    }
}
